﻿#region License

/*
    Copyright (c) 2012 Joseph Haluska
    This source is subject to the Microsoft Public License (Ms-PL).
    Please see http://www.microsoft.com/en-us/openness/licenses.aspx for details.
    All other rights reserved.
*/

#endregion License

using System;
using System.ComponentModel;

namespace NetExceptionReporter
{
    [Serializable()]
    public class ExceptionWindowData
    {
        #region Properties

        [DefaultValue(null)]
        public Exception Exception { get; private set; }

        [DefaultValue(null)]
        public IExceptionWindowBehavior Behavior { get; private set; }

        [DefaultValue(false)]
        public bool ShuttingDown { get; private set; }

        #endregion Properties

        #region Constructor

        private ExceptionWindowData()
        {
            /* Disabled constructor */
        }

        public ExceptionWindowData(Exception exception, IExceptionWindowBehavior behavior, bool shuttingDown)
        {
            if (exception == null)
                throw new ArgumentNullException("exception");

            if (behavior == null)
                throw new ArgumentNullException("behavior");

            Exception = exception;
            Behavior = behavior;
            ShuttingDown = shuttingDown;
        }

        #endregion Constructor
    }
}